/* 战斗管理单例 */
var FightMgr = (function(obj){
    var _inc;

    function _FightMgr(){
        var self = this;
        //是否在战斗中
        self._binfight = false;


        self._fightitem = undefined;
        /**
         * 开始一场战斗
         * @param {ENUM_FIGHT_TYPE}ftype 战斗类型
         * @param {int}fdata 战斗初始数据
         */
        self.startFight = function(ftype, fdata){
            var fitem = FightFactory.create(ftype)
            fitem.startFight(fdata);
            self._fightitem = fitem;
        }

        self.process = function(dt){
            if (self._fightitem){
                self._fightitem.process(dt)
            }
        }


        /**
         * 结束一场战斗
         */
        self.endFight = function(){
            self._binfight = false;

        };
    }

    var _static = {
        Instance:function(){
            if (_inc === undefined){
                _inc = new _FightMgr();
            }
            return _inc
        }
    }
    return _static;
})();